#include "pwm.h"
void set_period(unsigned int period)
{
    *(volatile unsigned int *)PWM_BASE_ADDR = period;
}

void set_pulse(unsigned int pulse)
{
    *(volatile unsigned int *)(PWM_BASE_ADDR + 0x4) = pulse;
}  
void set_size(unsigned int size)
{
    *(volatile unsigned int *)(PWM_BASE_ADDR + 0x8) = size;
}
void set_enable(unsigned int enable)
{
    *(volatile unsigned int *)(PWM_BASE_ADDR + 0xC) = enable;
}

unsigned int get_period()
{
    return *(volatile unsigned int *)PWM_BASE_ADDR;
}
unsigned int get_pulse()
{
    return *(volatile unsigned int *)(PWM_BASE_ADDR + 0x4);
}
unsigned int get_size()
{
    return *(volatile unsigned int *)(PWM_BASE_ADDR + 0x8);
}
unsigned int get_enable()
{
    return *(volatile unsigned int *)(PWM_BASE_ADDR + 0xC);
}